From 2315da9ba0ec2b7dbd21c676051559775ad48ee9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=98yvind=20Kol=C3=A5s?= Date: Wed, 13 Sep 2017 18:04:49 +0200 Subject: [PATCH] babl: skip unknown formats when loading cache Fixes bug #787467. Formats based on custom primaries provided by applications are unknown to babl at launch, we still want to keep the data though, since this list of most used fishes first is useful resource in combination with the warnings about missing fast paths. --- babl/babl-cache.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/babl/babl-cache.c b/babl/babl-cache.c index 0200a11..fa3f387 100644 --- a/babl/babl-cache.c +++ b/babl/babl-cache.c @@ -257,7 +257,7 @@ void babl_init_db (void) } break; case '\t': - if (strchr (token, '=')) + if (to_format && strchr (token, '=')) { char seps2[] = " "; char *tokp2; @@ -307,7 +307,7 @@ void babl_init_db (void) token2 = strtok_r (NULL, seps2, &tokp2); } } - else + else if (to_format) { Babl *conv = (void*)babl_db_find(babl_conversion_db(), &token[1]); if (!conv) @@ -322,14 +322,10 @@ void babl_init_db (void) if (!from_format) { from_format = (void*)babl_db_find(babl_format_db(), token); - if (!from_format) - return; } else { to_format = (void*)babl_db_find(babl_format_db(), token); - if (!to_format) - return; } break; } -- 2.30.2